#include<dirent.h>
#include<stdio.h>

/*
buffer.c
.
1.txt
f_open.c
ffush.c
wsystime_fileIO.c
readdir.c
test.txt
ftest.txt
1.bin
fgetc_fputc.c
fputs_puts.c
fprintf_fscanf.c
fgets_gets.c
fseek_frewind_ftell.c
wsystime.c
sprintf_sscanf.c
..
readwrite.c
a.out
open.c
fread_fwrite.c

 *
 */

int main(){
	//打开目录
	DIR * dir = opendir("/home/linux/CProject/IO");
	struct dirent * dt;
	if(dir == NULL){
		perror("opendir");
		return 0;
	}

	//读取目录
	while((dt = readdir(dir)) != NULL){
		printf("%s\n", dt->d_name);
	}

	//关闭目录
	closedir(dir);
}
